Skip to content

fix: ensure not soft logged out in pushhelper#2398

Merged
krille-chan merged 1 commit into
mainfrom
krille/only-request-notifications-if-event-forbidden
Jul 8, 2026
Merged

fix: ensure not soft logged out in pushhelper#2398
krille-chan merged 1 commit into
mainfrom
krille/only-request-notifications-if-event-forbidden

Conversation

@krille-chan

Copy link
Copy Markdown
Contributor

fixes an error report in FluffyChat which therefore also can happen in Famedly. Should reduce the amount of unable to fetch events in notifications a little bit.

@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Single defensive call in an existing error-handling path; no auth or API contract changes beyond refreshing the session before getNotifications().

Overview
When getEventByPushNotification cannot load an event via getOneRoomEvent and falls back to getNotifications(), it now calls ensureNotSoftLoggedOut() immediately before that request.

Push handling often runs with background sync off, so the access token can expire after the existing early ensureNotSoftLoggedOut() at the start of the method. Refreshing again on the fallback path avoids failed /notifications calls and reduces “unable to fetch event” errors for notification-driven flows (e.g. FluffyChat / Famedly).

Reviewed by Cursor Bugbot for commit 2173a42. Bugbot is set up for automated code reviews on this repo. Configure here.

fixes an error report in FluffyChat
which therefore also can happen
in Famedly. Should reduce the
amount of unable to fetch
events in notifications a little
bit.
@krille-chan krille-chan force-pushed the krille/only-request-notifications-if-event-forbidden branch from 5100bb4 to 2173a42 Compare July 8, 2026 07:20
@krille-chan krille-chan enabled auto-merge July 8, 2026 07:21
@krille-chan krille-chan merged commit b80a81c into main Jul 8, 2026
17 checks passed
@krille-chan krille-chan deleted the krille/only-request-notifications-if-event-forbidden branch July 8, 2026 07:35
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.28%. Comparing base (2040db7) to head (2173a42).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/client.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2398      +/-   ##
==========================================
- Coverage   59.29%   59.28%   -0.01%     
==========================================
  Files         161      161              
  Lines       20303    20304       +1     
==========================================
  Hits        12038    12038              
- Misses       8265     8266       +1     
Files with missing lines Coverage Δ
lib/src/client.dart 78.01% <0.00%> (-0.06%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2040db7...2173a42. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants